CREATE TRIGGER UserAccountAssetGroup_Defaults
ON UserAccountAssetGroup
AFTER INSERT AS
BEGIN
    UPDATE UserAccountAssetGroup
    SET
        Dashboard = 1,
        Email = 1
    WHERE ID IN (SELECT ID FROM inserted)
END

ALTER VIEW EventView
AS
SELECT
    Event.ID,
    Event.FileGroupID,
    Event.MeterID,
    Event.LineID,
    Event.EventTypeID,
    Event.EventDataID,
    Event.Name,
    Event.Alias,
    Event.ShortName,
    Event.StartTime,
    Event.EndTime,
    Event.Samples,
    Event.TimeZoneOffset,
    Event.SamplesPerSecond,
    Event.SamplesPerCycle,
    Event.Description,
    Event.FileVersion,
    Event.UpdatedBy,
    MeterLine.LineName,
    Meter.Name AS MeterName,
    MeterLocation.Name AS StationName,
    Line.Length,
    EventType.Name AS EventTypeName
FROM
    Event JOIN
    Meter ON Event.MeterID = Meter.ID JOIN
    MeterLocation ON Meter.MeterLocationID = MeterLocation.ID JOIN
    Line ON Event.LineID = Line.ID JOIN
    MeterLine ON MeterLine.MeterID = Meter.ID AND MeterLine.LineID = Line.ID JOIN
    EventType ON Event.EventTypeID = EventType.ID
GO